-
-
Notifications
You must be signed in to change notification settings - Fork 241
fix(modal): missing animated & stretched params #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can one of the admins verify this patch? |
@ddfreiling I don't think it was our intention to provide a different API for View/ViewBase.showModal(...) so I streamlined it with NativeScript/NativeScript#5734. Also, generally there are scenarios where we would like to open a modal view from ViewBase instance (e.g. TabViewItem) but it seems this functionality was not working at the moment -- made a second PR to fix it: NativeScript/NativeScript#5737 Till both PRs are merged and released I would suggest you to replace the snippet // parentView typed as ViewBase, but only View takes stretched param.
if (parentView instanceof View) {
parentView.showModal(page, context, closeCallback, fullscreen, animated, stretched);
} else {
parentView.showModal(page, context, closeCallback, fullscreen, animated);
} with // TODO: remove <any> cast after https://github.com/NativeScript/NativeScript/pull/5734 is merged
(<any>parentView).showModal(page, context, closeCallback, fullscreen, animated, stretched); |
@manoldonev updated to use new showModal signature |
@ddfreiling can you use the <any> cast above as thou the PRs are merged they are not public yet (no tns-core-modules official releases): // TODO: remove <any> cast after https://github.com/NativeScript/NativeScript/pull/5734 is merged
(<any>parentView).showModal(page, context, closeCallback, fullscreen, animated, stretched); |
showModal with all params has been merged, but awaiting new release of tns-core-modules
…ngular into fix/modal-params
test |
PR Checklist
What is the current behavior?
ModalDialogOptions did not include the new
animated
andstretched
params introduced with Nativescript 4.0What is the new behavior?
ModalDialogOptions now includes optional
animated
andstretched
paramsFixes #1292
No breaking changes, no migration steps.
Question for reviewer
In dialogs.ts parentView is typed as ViewBase, but in my experience was always a View at runtime, is it safe to cast this instead of checking instanceof?